package com.po;

import com.utils.JDBCUnits;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 纸条的基本信息
 */
public class Note {
    //纸条的名字
    private String note_name;
    //纸条获赞的总数
    private int priase_number;
    //纸条的id
    private int note_id;
    //纸条的内容
    private String content;
    //纸条的创建时间
    private String create_time;
    //纸条的引用
    private String quote;

    public String getQuote() {
        return quote;
    }

    public void setQuote(String quote) {
        this.quote = quote;
    }

    public Note(String note_name, int priase_number, String content, int note_id , Date date ,String quote) {
        this.note_name = note_name;
        this.priase_number = priase_number;
        this.content = content;
        this.note_id = note_id;
        DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        this.create_time = format.format(date);
        this.quote = quote;
    }

    public String getNote_name() {
        return note_name;
    }

    public void setNote_name(String note_name) {
        this.note_name = note_name;
    }

    public int getPriase_number() {
        return priase_number;
    }

    public void setPriase_number(int priase_number) {
        this.priase_number = priase_number;
    }

    public int getNote_id() {
        return note_id;
    }

    public void setNote_id(int note_id) {
        this.note_id = note_id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setCreate_time(Date date){
        DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        this.create_time = format.format(date);
    }

    public String getCreate_time(){
        return create_time;
    }

}
